/*
 *此部分是2011年12月29日用来弥补wb_demo_status表中不存在的用户的，用户被插入到了wb_demo_user中
 */
package sinaEx;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import weibo4j.Users;
import weibo4j.model.WeiboException;
import spider.*;
/**
 *
 * @author Administrator
 */
public class getUsernameDemoEmpty {
    public static void main(String[] args) throws IOException, WeiboException, ClassNotFoundException, InstantiationException, IllegalAccessException, SQLException{
        spider.Auth4Code.prepareWeibo();
        Users um=new Users();
        List<String> fid=new ArrayList<String>();
        BufferedReader reader=new BufferedReader(new InputStreamReader(new FileInputStream("F:\\Sina\\spider\\src\\sinaEx\\demo_empty_fid")));
        String line=reader.readLine();
        line=reader.readLine();
        String table="wb_demo_user";
        String[] columns={"uid","username"};
        String[] values=new String[2];
        while(line!=null){
            String username=um.showUserById(line).getName();
            values[0]=line;
            values[1]=username;
            SQL.SQL(SQL.insert(columns, values, table));            
        }
        reader.close();
    }
    
}
